/** \file
* Implementation of the poortable XML file source class.
* This file is part of Chorus, available at
* http://code.google.com/p/chorus-twitter/ . This file and all associated files
* and derivative works are bound by the terms of the LGPL 3.0 license,
* available at http://www.gnu.org/licenses/lgpl-3.0-standalone.html .
* \par Subversion URL:
* \$URL: http://chorus-twitter.googlecode.com/svn/branches/cpp/src/xml/XmlFileSource.hpp $
* \version \$Rev: 153 $
* \date    \$Date: 2010-04-06 07:43:42 +0000 (Tue, 06 Apr 2010) $
*/

#pragma once

#include "XmlSource.hpp"

/// The XMl file reader class. For portability, compile XmlFileSource-posix.cpp
/// or XmlFileSource-win32.cpp depending on which system you need.
class XmlFileSource : public XmlSource
{
public:
	/// The constructor.
	/// \param treeInit The XmlTree to which we send parse events.
	/// \param pathInit The path to the file.
	XmlFileSource(XmlTree *treeInit, const char *pathInit);
	/// The destructor.
	virtual ~XmlFileSource();

private:
	/// "Localize" the file path for this particular system.
	/// \param pathInit The path string to consider.
	/// \return The localized path string.
	std::string localizePath(const char *pathInit);

	/// Perform the file read.
	/// \return True for success.
	virtual bool perform();

private:
#ifdef WIN32
	/// The sector size of the disc.
	unsigned long sectorsize;
	/// The size of the read chunk.
	unsigned long readsize;
#endif
};
